/* 
    > 做法：
        1. 对于每个委托关系中的函数，在服务对象端简历一个简单的委托函数；
        2. 调整客户端，令它只调用服务对象提供的函数，每次调整后运行测试；
        3. 如果将来不再有任何客户端需要去用Delegate（受托类），便可移除服务对象中的相关访问函数；
        4. 测试。
*/
class Person {
    constructor(name) {
        this._name = name;
    }
    get name() {
        return this._name;
    }
    get department() {
        return this._department;
    }
    set department(arg) {
        this._department = arg;
    }
}

class Department{
    get chargeCode(){
        return this._chargeCode;
    }
    set chargeCode(arg){
        return this._chargeCode = arg;
    }

    get manager(){
        return this._manager;
    }
    set manager(arg){
        return this._manager = arg;
    }
}

var manager = aPerson.department.manager;
/********************************************** */
class Person {
    constructor(name) {
        this._name = name;
    }
    get name() {
        return this._name;
    }
    get department() {
        return this._department;
    }
    set department(arg) {
        this._department = arg;
    }

    get manager(){
        return this._department.manager;
    }
}

var manager =aPerson.manager;